package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.admin.wap.service.BrandInfoService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 龙 路 飞
 * @CreateDate: 2021-11-09 16:41
 * @Description:
 */
@RestController
@RequestMapping("/api/brandInfo")
public class BrandInfoController extends UserInfoController{
    @Autowired
    private BrandInfoService brandInfoService;

    @GetMapping("/findByUserId")
    public ServerResponse findByUserId(HttpServletRequest request){
        UserInfo userInfo = super.getLoginUserInfo(request);
        return ServerResponse.createBySuccess(brandInfoService.findByUserId(userInfo.getId()));
    }
}
